﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Castle.MicroKernel.Registration;
using Data.Mappers;
using Data.Db;

namespace Shop.Installers
{
    public class ManagersInstaller : IWindsorInstaller
    {
        public void Install(Castle.Windsor.IWindsorContainer container, Castle.MicroKernel.SubSystems.Configuration.IConfigurationStore store)
        {
            container.Register(Classes.FromThisAssembly()
                    .Where(Component.IsInSameNamespaceAs<Managers.ManagerProduct>())
                    .WithService.AllInterfaces()
                    .LifestylePerWebRequest());

            container.Register(Classes.FromThisAssembly()
                    .Where(Component.IsInSameNamespaceAs<Managers.ManagerBasket>())
                    .WithService.AllInterfaces()
                    .LifestylePerWebRequest());

            container.Register(Classes.FromThisAssembly()
                    .Where(Component.IsInSameNamespaceAs<Managers.ManagerCategory>())
                    .WithService.AllInterfaces()
                    .LifestylePerWebRequest());
        }
    }
}